﻿/* DotNetHoldem 
 * .Net Solution that allows to use OpenHoldem with .Net logic
 * Author: Óscar Andreu
 * oesido at gmail dot com
 * Licensed under GPLv3 - 2012
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotNetBotLogic.Classes;
using DotNetBotLogic.Enums;
using DotNetBotLogic.Classes.BetRoundClasses;
using DotNetBotLogic.Classes.Log;

namespace DotNetBotLogic.Controllers
{
    internal class BaseController
    {
        #region Static

        internal static double BBlind = 0;       

        #endregion

        #region Variables

        internal BetRounds BetRound { get { return MainController.BetRound; } }
        internal int BetTurn { get { return MainController.BetTurn; } }

        #endregion

        #region Constructor

        internal BaseController()
        {
        }

        #endregion

        internal virtual double GetActionResult()
        {
            BetRoundBase brClass = null;

            if (BetRound == BetRounds.Preflop)
            {
                brClass = Preflop();
            }
            else if (BetRound == BetRounds.Flop)
            {
                brClass = Flop();
            }
            else if (BetRound == BetRounds.Turn)
            {
                brClass = Turn();
            }
            else if (BetRound == BetRounds.River)
            {
                brClass = River();
            }

            return brClass == null ? 0 : brClass.getAction(); ;
        }

        #region Virtual

        protected virtual BetRoundBase Preflop() { return null; }
        protected virtual BetRoundBase Flop() { return null; }
        protected virtual BetRoundBase Turn() { return null; }
        protected virtual BetRoundBase River() { return null; }

        #endregion
    }
}
